Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(alloy): forward rustls & native reqwest TLS configuration to Alloy's metacrate #969

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Jun 25, 2024

Motivation

Closes #965

In support of the suggested feature as people often express their preference for one over the other

Solution

Avoids introducing breaking changes, adds two new flags: reqwest-rustls-tls and reqwest-native-tls

If a breaking change were permitted I would add the flag like this:

[features]
default = ["std", "reqwest", "reqwest-default-tls"]
# std
std = [
"alloy-core/std",
"alloy-eips?/std",
"alloy-genesis?/std",
"alloy-serde?/std",
"alloy-consensus?/std",
]
# full
full = [
"consensus",
"contract",
"eips",
"k256",
"kzg",
"network",
"provider-http", # includes `providers`
"provider-ws", # includes `providers`
"provider-ipc", # includes `providers`
"rpc-types", # includes `rpc-types-eth`
"signer-local", # includes `signers`
]
# configuration
reqwest = [
"dep:reqwest",
"alloy-rpc-client?/reqwest",
"alloy-provider?/reqwest",
"alloy-transport-http?/reqwest",
]
reqwest-default-tls = ["reqwest", "alloy-transport-http?/reqwest-default-tls"]
reqwest-rustls-tls = ["reqwest", "alloy-transport-http?/reqwest-rustls-tls"]
reqwest-native-tls = ["reqwest", "alloy-transport-http?/reqwest-native-tls"]

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks changed the title feat(alloy): forward rustls configuration to Alloy's metacrate feat(alloy): forward rustls & native reqwest TLS configuration to Alloy's metacrate Jun 25, 2024
@zerosnacks zerosnacks marked this pull request as ready for review June 25, 2024 11:36
@mattsse mattsse merged commit 4b5541e into main Jun 25, 2024
22 checks passed
@mattsse mattsse deleted the zerosnacks/rustls-reqwest-feature-flag branch June 25, 2024 15:28
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
… Alloy's metacrate (alloy-rs#969)

* add reqwest feature flags to metacrate

* enable reqwest when enabling sub-flag for consistency

* remove redundant reqwest entry

* avoid breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] feature flag for rustls with reqwest
3 participants